Example Code

Write spreadsheet - Columns

Code and Documents

Attachment

Functional Description

When using the Write to Spreadsheet file VI, new data is added to the file underneath the existing data as new row(s).  In order to add data as new columns, you can first create the file in the row format, then when all data is saved to the file you can read the file back, transpose the 2D array, and then rewrite the file.  This is shown in this example.

Write spreadsheet columns_LV82.PNG

Data in Vertical format:

Column0    0    1    2    3    4
Column1    0    1    2    3    4
Column2    0    1    2    3    4

Data in Horizontal format:

Column0    Column1    Column2
0                 0                 0
1                 1                 1
2                 2                 2
3                 3                 3
4                 4                 4

Caveats and Additional Note

If your data file is very large, reading it into LabVIEW will take up a large amount of memory.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors